<template>
  <div>
    <el-row :gutter="24">
      <el-col :span="12">
        <div class="grid-content bg-purple">
          <el-card style="height: 490px">
            <div>
              <div style="text-align: center">
                <h1>投诉受理执行组</h1>
              </div>
              <div>
                <filterSelect
                  width="500px"
                  v-model="list"
                  @input="getChangeData"
                ></filterSelect>
              </div>
            </div>
          </el-card>
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { getConfigByKeyName, saveByKeyName } from "@/api/system/sysConfig";
import { createUserRelation } from "@/api/permission/userRelation";
import { getPlaybackUser } from "@/api/permission/user";

export default {
  data() {
    return {
      flag: false,
      flag2: false,
      value: "",
      value1: "",
      list: [
        { type: "company", selectArr: [] },
        {
          type: "department",
          selectArr: [],
        },
        {
          type: "Role",
          selectArr: [],
        },
        {
          type: "Position",
          selectArr: [],
        },
        {
          type: "Group",
          selectArr: [],
        },
        {
          type: "user",
          selectArr: [],
        },
        {
          type: "exclude",
          selectArr: [],
        },
      ],
      options: [],
      form: {
        keyValue: "",
      },
    };
  },
  mounted() {
    this.getPeopleList();
  },
  methods: {
    getPeopleList() {
      var cleanManageAuto = "complainManageAccept";
      getConfigByKeyName(cleanManageAuto)
        .then((res) => {
          if (res.data != null) {
            this.list = JSON.parse(res.data.keyValue);
          }
        })
        .catch(() => {});
    },
    getChangeData() {
      var _keyValue = JSON.stringify(this.list);
      this.form.keyValue = _keyValue;
      this.form.keyName = "complainManageAccept";
      this.form.name = "投诉受理组";
      this.form.category = "complainManage";
      saveByKeyName(this.form)
        .then((res) => {
          this.$message.success(res.msg);
        })
        .catch(() => {});
    },
  },
};
</script>

<style></style>
